package kit.edu.lego.gruppe3.levels.treeArea.entrance;

import kit.edu.lego.gruppe3.ComponentsRepository;
import kit.edu.lego.gruppe3.levels.LevelSolver;
import lejos.robotics.navigation.DifferentialPilot;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;

public class EntranceSolver implements LevelSolver{
	
	private DifferentialPilot robot = ComponentsRepository.getInstance().getRobotPilot();

	@Override
	public void start() {
		robot.rotate(90);
		
		Behavior findRightSide = new FindRightWall();
		Behavior moveParallel = new MoveParallelToWall();
		Behavior hitFrontWall = new HitFrontWall();
		Behavior entranceEnd = new EntranceEndReached();
		
		Behavior[] behaviors = {moveParallel, findRightSide, hitFrontWall, entranceEnd};
		
		Arbitrator arby = new Arbitrator(behaviors);
		arby.start();
	}

}
